<!DOCTYPE HTML>
<html>
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
  <meta charset="UTF-8">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <title>Shoping cart</title>
  <link rel="shortcut icon" href="favicon.ico">
  <link href="css/style.css" media="screen" rel="stylesheet" type="text/css">
  <link href="css/grid.css" media="screen" rel="stylesheet" type="text/css">

  <script src="js/jquery-1.7.2.min.js" ></script>
  <script src="js/html5.js" ></script>
  <script src="js/jflow.plus.js" ></script>
  <script src="js/jquery.carouFredSel-5.2.2-packed.js"></script>
  <script src="js/checkbox.js"></script>
  <script src="js/radio.js"></script>
  <script src="js/selectBox.js"></script>

  <script>
       $(document).ready(function(){
	      $("#myController").jFlow({
		     controller: ".control", // must be class, use . sign
		     slideWrapper : "#jFlowSlider", // must be id, use # sign
		     slides: "#slider",  // the div where all your sliding divs are nested in
		     selectedWrapper: "jFlowSelected",  // just pure text, no sign
		     width: "984px",  // this is the width for the content-slider
		     height: "480px",  // this is the height for the content-slider
		     duration: 400,  // time in miliseconds to transition one slide
		     prev: ".slidprev", // must be class, use . sign
		     next: ".slidnext", // must be class, use . sign
		     auto: true
	      });
       });
  </script>
  <script>
       $(function() {
	  $('#list_product').carouFredSel({
		prev: '#prev_c1',
		next: '#next_c1',
		auto: false
	  });
          $('#list_product2').carouFredSel({
		prev: '#prev_c2',
		next: '#next_c2',
		auto: false
	  });
	  $(window).resize();
	});
  </script>
  <script>
       $(document).ready(function(){
	      $("button").click(function(){
		     $(this).addClass('click')
	      });
       })
  </script>
 

</head>
<body>
  

  <div class="clear"></div>

  <section id="main" class="entire_width">
    <div class="container_12">
       <div class="grid_12">
       <h1 class="page_title">购物车</h1>

       <table class="cart_product">
	      <tr>
		     <th class="images"></th>
		     <th class="bg name">产品名称</th>
		     <th class="bg price">单价</th>
		     <th class="qty">数量</th>
		     <th class="bg subtotal">总价</th>
		     <th class="close"> </th>
	      </tr>
	      <if condition="(empty($cartArray))">
	       <tr>
		     <td colspan="6" class="cart_but">
				   购物车为空
		     </td>
	      </tr>	
	      <else/>
		      <foreach name="cartArray" item="cartinfo">
		      <tr>
			     <td class="images"><a target="_blank" href="{:U('Index/proDetail',array('id'=>$cartinfo['productid']))}"><img src="/{$cartinfo['image']}" alt="Product 6"></a></td>
			     <td class="bg name">{$cartinfo['pname']}</td>
			     <td class="bg price" id="shop_price">{$cartinfo['shop_price']}</td>
			     <td class="qty"><input onchange="changeNum(this);" shopprice="{$cartinfo['shop_price']}" productid="{$cartinfo['productid']}" type="text" name="number" value="{$cartinfo['number']}" placeholder="1000" /></td>
			     <td id="subtotal" class="bg subtotal">{$cartinfo['price']}</td>
			     <td class="close"><a title="close" class="close" href="javascript:delOrder(this,{$cartinfo['productid']},{$cartinfo['number']});" productid=""></a></td>
		      </tr>
		      </foreach>
	      </if>
	      <tr>
		     <td colspan="6" class="cart_but">
			    <button class="continue"><span>icon</span>清空购物车</button>
			    <button class="update"><span>icon</span>结算</button>
		     </td>
	      </tr>
       </table>
       </div><!-- .grid_12 -->

       
      <div class="clear"></div>
      
    </div><!-- .container_12 -->
  </section><!-- #main -->

<script type="text/javascript">

function changeNum(doc)
{
	var number=$(doc).val();
	var productid=$(doc).attr("productid");
	var price=$(doc).attr("shopprice");
	//var price=$(doc).prevAll("#shop_price").html();
	$.get('{:U("Cart/manage")}',{"number":number,"productid":productid,"do":"update"},function(data){
		if(data=='su'){
			$(doc).parent().nextAll("#subtotal").html(price*number);
		}
	},'json');
}
function delOrder(doc,productid,number)
{
	$.get('{:U("Cart/manage")}',{"sign":productid+"|"+number,"do":"delete"},function(data){
		if(data=='su'){
			window.location.reload();
			//$(doc).parent().parent().hide();
		}
	},'json');
}
</script>
  <div class="clear"></div>

  